local U = require "packages/utility/utility"

local botu = fk.CreateSkill{
  name = "steam__botu"
}

Fk:loadTranslationTable{
  ["steam__botu"] = "博图",
  [":steam__botu"] = "出牌阶段限一次，你可以重铸四张花色不同的牌，然后视为使用一张【兵临城下】。",
    
  ["#steam__botu"] = "博图：出牌阶段限一次，你可以重铸四张花色不同的牌，然后视为使用一张【兵临城下】。",
}

botu:addEffect("viewas", {
  prompt = "#steam__botu",
  anim_type = "offensive",
  pattern = "slash",
  card_filter = function (self, player, to_select, selected)
    if not table.contains(player:getCardIds("h"), to_select) then return end
    if #selected == 0 then
      return true
    else 
        for _,cid in ipairs(selected) do
            local card=Fk:getCardById(cid)
            if card.suit == Fk:getCardById(to_select).suit then return false end
        end
        return true
    end
  end,
  max_turn_use_time = 1,
  view_as = function (self, player, cards)
    local slash = Fk:cloneCard("enemy_at_the_gates")
    slash.skillName = botu.name
    if #cards == 4 then
      slash:addFakeSubcards(cards)
      return slash
    end
  end,
  before_use = function (self, player, use)
    local room = player.room
    room:recastCard(use.card.fake_subcards, player, self.name)
  end,
})


return botu